package monopoly;



public class Railroad extends Property {
	
	public Railroad()
	{
		super();
	}
	
	public Railroad(double price, String description)
	{
		super(price, "images/tableIcon/rr.gif", description);
	}

	public double getRent(GameState gameState, int rentMultiplier)
	{
		int count;
		double rent;
		Player owner = super.getOwner();
		count = owner.getRailroadCount();
		
		switch (count)
		{
		case 1:	rent =  25.0; break;
		case 2:	rent =  50.0; break;
		case 3:	rent = 100.0; break;
		case 4:	rent = 200.0; break;
		default: rent =  0.0;
		}
		
		if (rentMultiplier != 0) rent *= rentMultiplier;
		return rent;
	}
	
	
	public void purchase(Player player)
	{
			player.adjustBalance(0-super.getPrice());
			super.setOwner(player);
			player.buyRailroad(this);
	}
}
